package de.bazinga.rotw.network.message;

import com.captiveimagination.jgn.message.Message;
import com.captiveimagination.jgn.message.type.CertifiedMessage;
import com.captiveimagination.jgn.message.type.PlayerMessage;
import com.captiveimagination.jgn.message.type.TimestampedMessage;

import de.bazinga.rotw.game.RotwGameState;
import de.bazinga.rotw.person.OpponentList;

public class FallDiedMessage extends Message implements CertifiedMessage, PlayerMessage, TimestampedMessage, GameMessage {

	public void handleMessage(RotwGameState game, Message msg, boolean server) {
		if(!(msg instanceof FallDiedMessage)) return ;

		// Player touched a item
		FallDiedMessage message = (FallDiedMessage)msg;
		
		if(server) {
			OpponentList.getInstance().getOpponent(message.getPlayerId()).decreaseScore();
		}
	}
}